//
//  FooterTableViewCell.m
//  TodatPlay
//
//  Created by dllo on 16/9/14.
//  Copyright © 2016年 DM.C. All rights reserved.
//

#import "FooterTableViewCell.h"

@interface FooterTableViewCell ()
@property (nonatomic, copy) ShowButton show;
@property (nonatomic, copy) PackButton pack;
@end

@implementation FooterTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    [self.footerButton addTarget:self action:@selector(handleButton:) forControlEvents:UIControlEventTouchUpInside];
    
}
- (void)showButton:(ShowButton)show {
    self.show = show;
}
- (void)packButton:(PackButton)pack {
    self.pack = pack;
}
- (void)handleButton:(UIButton *)button {
    
    [self.footerButton setTitle:@"查看07:00更多项目>>" forState:UIControlStateNormal];
    [self.footerButton removeTarget:self action:@selector(handleButton:) forControlEvents:UIControlEventTouchUpInside];
    [self.footerButton addTarget:self action:@selector(handleShouqi:) forControlEvents:UIControlEventTouchUpInside];
    self.show(button);
}

- (void)handleShouqi:(UIButton *)button {
    [self.footerButton setTitle:@"收起07:00更多项目>>" forState:UIControlStateNormal];
    [self.footerButton removeTarget:self action:@selector(handleShouqi:) forControlEvents:UIControlEventTouchUpInside];
    [self.footerButton addTarget:self action:@selector(handleButton:) forControlEvents:UIControlEventTouchUpInside];
    self.pack(button);
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
